using Microsoft.AspNetCore.Mvc;

namespace Server.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class TestController : ControllerBase
    {
        // 一个简单的GET端点，返回硬编码的数据
        [HttpGet("simple")]
        public ActionResult<object> GetSimpleData()
        {
            try
            {
                // 返回硬编码的数据，不涉及数据库操作
                var testData = new {
                    Message = "测试成功!",
                    Timestamp = DateTime.Now,
                    Status = "Server is running normally"
                };
                return Ok(testData);
            }
            catch (Exception ex)
            {
                return StatusCode(500, new {
                    Message = "测试失败",
                    Error = ex.Message
                });
            }
        }
    }
}